#!/usr/bin/python
# -*- coding: UTF-8 -*-

"""
Description: TestWrapper

"""
from kptest import log
from kptest.config.enum import HostType, CommandType
from kptest.wrapper.wrapperbase import WrapperBase

from extension.wrapper.test import parser


class TestWrapper(WrapperBase):
    host_types = (HostType.BMC,)
    command_types = (CommandType.BMCSSH, CommandType.SERIALClI)
    modules = [
        "extension.wrapper.test.sub_wrapper"
    ]

    def __init__(self, _params=None):
        super(TestWrapper, self).__init__(_params)
        self.logger = log.get_logger(__name__)

    def test_wrapper_method(self):
        self.logger.info("call wrapper success.")
        # 查询风扇工作状态（faninfo）
        cmd_str = "ipmcget -d faninfo"
        cmd = cmd_str.split(" ")
        return [{"cmdline": cmd, "parser": parser.parse_fan_info}]
